package com.ybdz.scanner.utils;

import android.annotation.SuppressLint;
import android.content.Context;
import android.widget.Toast;

/**
 * @ClassName: MyToast
 * @author: zhao
 * @Description:
 * @date 2017/12/12 11:34
 */
public class MyToast {

    private static Toast toast;

    @SuppressLint("ShowToast")
    public static void show(Context context, String msg){
        if (toast == null){
            toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
        }else {
            toast.setText(msg);
        }

        toast.show();


    }
}
